package models;

import play.db.jpa.GenericModel;
import play.db.jpa.Model;
import play.data.validation.Required;
import play.data.validation.MaxSize;

import java.math.BigDecimal;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;


/**
 * Model Asignatura generated by Play!
 */

@Entity
@Table(name="ASIGNATURA")
public class Asignatura extends GenericModel {
	
	@Id
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="SEQ_ASIGNATURA")
	@SequenceGenerator(name="SEQ_ASIGNATURA", sequenceName="SEQ_ASIGNATURA", allocationSize=1)
	private long idasignatura;
    @Required
    @ManyToOne
    public Departamento departamento;
    @Required
    @MaxSize(25)
    public String nombreasignatura;
    @Required
    public BigDecimal uv;
    //@OneToMany(mappedBy="ASIGNATURA")  
    //public Set<Grupo> grupos = new HashSet<Grupo>(0);
    //@OneToMany(mappedBy="ASIGNATURA")  
    //public Set<DocenteAsignatura> docenteAsignaturas = new HashSet<DocenteAsignatura>(0);

    //default constructor 
    public Asignatura() {
    }
    public Asignatura(long idasignatura) {
     	this.idasignatura = idasignatura;
    }
   


}


